import request from '@/utils/axios'

export type OAuth2TokenType = {
  id: number
  accessToken: string
  refreshToken: string
  userId: number
  userType: number
  clientId: string
  createTime: Date
  expiresTime: Date
}

export interface OAuth2TokenPageReqType extends PageParam {
  userId?: string
  userType?: number
  clientId?: string
}

/**
 * OAuth2 token接口
 */
export const OAuth2TokenApi = {
  // 删除
  delete: (accessToken: string) => {
    return request.delete({ url: '/system/oauth2-token/delete?accessToken=' + accessToken, is_mock: true })
  },
  // 查询分页列表
  page: (params: OAuth2TokenPageReqType) => {
    return request.get({ url: '/system/oauth2-token/page', params, is_mock: true })
  }
}
